package com.bawei.a2010douyin.widget;

import android.content.Context;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
//聊天列表：上方模糊 下方不模糊
public class ChatRecyclerView extends RecyclerView {
    public ChatRecyclerView(@NonNull Context context) {
        super(context);
    }

    public ChatRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public ChatRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    //垂直方向模糊：上下模糊
    @Override
    public boolean isVerticalFadingEdgeEnabled() {
        return true;
    }
    //下方的模糊范围变成0：不模糊
    @Override
    protected float getBottomFadingEdgeStrength() {
        return 0;
    }
    //上方模糊的范围100
    @Override
    protected float getTopFadingEdgeStrength() {
        return 100;
    }
}
